function Alert(msg){
	ymPrompt.alert({title:'提示',message:msg})
}

function Confirm(msg,onOk){
	ymPrompt.confirmInfo({title:"提示对话框",message:msg,handler:function(tp){
		if(tp=='ok')
			if(onOk != null) onOk();
	}});
}


function back(){
	history.go(-1);
}
function goTo(url)
{
	if(url !=null && url != "")
		self.location.href =url;
}

function swin(url,width,height)
{	
	var date=new Date();
	var target="i"+date.getTime()+"i";
	var left = ( screen.availWidth - width ) / 2;
    var top = ( screen.availHeight - height ) / 2;  
	window.open(url,target,'left='+left+',top='+top+',height='+height+',width='+width+',toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no');
}
function showremark(url,width,height){
	var i = window.showModalDialog(url,"", "dialogWidth: "+width+"px; dialogHeight: "+height+"px; help: no; scroll: no; status: no");
}
function wclose() 
{
	window.close()
}

/**jquery tooltip*/
function tiper(xoff, yoff, id) {

    this.xOffset = xoff;
    this.yOffset = yoff;
    var style = style
    if (!id) {
        var id = 'tiper';
    }
    if (!xoff) {
        this.xOffset = 20;
    }
    if (!yoff) {
        this.yOffset = 20;
    }
    $(".tiper").hover(
    function (e) {
        var div_id = this.id;
        var content = $('.' + div_id).html();
        this.top = (e.pageY + yOffset);
        this.left = (e.pageX + xOffset);
        alert(content)

        $('body').append('<div id="' + id + '">' + content + '</div>');
        $('div#' + id).css("top", this.top + "px").css("left", this.left + "px").fadeIn("slow");

    }, function () {
        $('div#' + id).fadeOut("slow").remove();
    }).mousemove(

    function (e) {
        this.top = (e.pageY + yOffset);
        this.left = (e.pageX + xOffset);

        $('div#' + id).css("top", this.top + "px").css("left", this.left + "px");
    });

};


//复选框全选，objectname表示要选择的复选框，focusId表示触发事件的控件的Id
function selectall(objectname,focusId){
	var i=0;
    var checkboxs = document.getElementsByName(objectname);
    if(document.getElementById(focusId).checked==true){
        for(i=0;i<checkboxs.length;i++){
       	 checkboxs[i].checked=true;
        }
    }else{
   	    for(i=0;i<checkboxs.length;i++){
       	 checkboxs[i].checked=false;
        }
    }
}
